<?php

namespace backend\models\base;

use Yii;

/**
 * This is the base-model class for table "shop_category".
 *
 * @property string $id
 * @property string $parent_id
 * @property integer $is_parent
 * @property string $name
 * @property integer $sort_order
 * @property integer $status
 * @property string $brands
 * @property string $attributes
 * @property string $specs
 */
class ShopCategory extends \yii\db\ActiveRecord
{



    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'shop_category';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['parent_id', 'is_parent', 'name'], 'required'],
            [['parent_id', 'is_parent', 'sort_order', 'status'], 'integer'],
            [['brands', 'attributes', 'specs'], 'string'],
            [['name'], 'string', 'max' => 200]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'parent_id' => '父类目',
            'is_parent' => '是否为父类目',
            'name' => '类目名',
            'sort_order' => '排序',
            'status' => '状态 1正常 0删除',
            'brands' => '品牌集',
            'attributes' => '属性集',
            'specs' => '规格集',
        ];
    }




}
